package ooday03;

public class AnimalTesting {
    public static void main(String[] args) {

        Dog []dd=new Dog[3];
        dd[0]=new Dog("大黄狗",2,"黄色");
        dd[1]=new Dog("大黑狗",3,"黑色");
        dd[2]=new Dog("大白狗",4,"白色");
        System.out.println(dd[0].name);
        dd[1].age=99;
        dd[2].swim();
        for (int i=0;i< dd.length;i++){
            System.out.println(dd[i].name);
            dd[i].eat();
        }

        Chick []ck=new Chick[2];
        ck[0]=new Chick("大金鸡",3,"金色");
        ck[1]=new Chick("大红鸡",8,"红色");
        ck[1].color="黑色";
        ck[0].drink();//金鸡喝水
        for (int i=0;i< ck.length;i++){
            System.out.println(ck[i].name);
            ck[i].layEggs();//
        }

        Fish[]f=new Fish[3];
        f[0]=new Fish("大金鱼",78,"金色");
        f[1]=new Fish("大肥鱼",9,"蓝色");
        f[2]=new Fish("大瘦鱼",32,"绿色");
        f[1].name="大飞鱼";
        f[2].swim();
        for (int i=0;i< f.length;i++){
            System.out.println(f[i].name);
            f[i].swim();
        }



    }
}
